import zhCN from 'ant-design-vue/es/locale/zh_CN.js';
import Empty from 'ant-design-vue/es/empty/index.js';
import AntdVue from 'ant-design-vue';
import antdMsg from './antdMsg.js';

import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn.js';
dayjs.locale('zh-cn');

export function useAntConfig() {
  let locale = zhCN;
  let emptyImage = Empty.PRESENTED_IMAGE_SIMPLE;
  let getPopupContainer = () => {
    return document.getElementById('app') || document.body;
  };

  return { locale, emptyImage, getPopupContainer };
}

export default {
  install(app) {
    app.use(AntdVue);
    app.use(antdMsg);
  },
};
